package phone.qyg.com.qyg.adapter;

import android.content.Context;

import com.app.adapter.recycler.CommonAdapter;
import com.app.adapter.recycler.base.ViewHolder;
import com.app.utils.OptionImageUtils;

import java.util.List;

import phone.qyg.com.qyg.R;
import phone.qyg.com.qyg.model.VolunteerBean;

public class VolunteerAdapter extends CommonAdapter<VolunteerBean> {
    int type = 0;
    public VolunteerAdapter(Context context, List<VolunteerBean> datas,int type) {
        super(context,R.layout.item_volunteer,datas);
        this.type = type;
    }
//    public VenueAdapter(Context context, List<String> datas) {
//        super(context, datas);
//        addItemViewDelegate(new VenueItemAdapter());
//    }

    @Override
    protected void convert(ViewHolder holder, VolunteerBean bean, int position) {
        holder.setImage(R.id.iv_head,bean.photo, OptionImageUtils.getRectRatioAct());
        holder.setText(R.id.tv_name,bean.name);
        holder.setText(R.id.tv_num,bean.click_count);
        if(type==0){
            holder.setVisible(R.id.tv_type,true);
            if(bean.type==0){
                holder.setText(R.id.tv_type,"类型:  个人");
            }else{
                holder.setText(R.id.tv_type,"类型:  团体");
            }

        }else{
            holder.setVisible(R.id.tv_type,false);
        }
    }

//    public class VenueItemAdapter implements ItemViewDelegate<String> {
//
//        @Override
//        public int getItemViewLayoutId() {
//            return R.layout.item_venue_two;
//        }
//
//        @Override
//        public boolean isForViewType(String item, int position) {
//            return false;
//        }
//
//        @Override
//        public void convert(ViewHolder holder, String o, int position) {
//
//        }
//    }
}
